package com.example.demo.response;
import lombok.Data;

@Data
public class Response <T>{
    public Integer code = 200;
    public String msg = "成功";
    private T data;

    public void setData(T data) {
        this.data = data;
    }

    public static <T> Response data(T data){
        Response response = new Response();
        response.setData(data);
        return response;
    }

    public static Response success(Integer code,String msg) {
        Response response = new Response();
        response.code = code;
        response.msg = msg;
        return response;
    }
}
